<?php
/**
 * Sale Model
 */
class Sale extends AppModel {
/**
 * associations
 *
 * @var array
 */
  var $belongsTo = array(
      'Customer' => array(
         'className' => 'Customer',
         'foreignKey' => 'customer_id',
         'conditions' => '',
         'order' => '',
         'limit' => '',
         'dependent' => false
      ),
      'Proforma' => array(
          'className' => 'Proforma',
          'foreignKey' => 'proforma_id',
          'conditions' => '',
          'order' => '',
          'limit' => '',
          'dependent' => false
      )
   );

   var $hasMany = array(
		'SaleItem' => array(
			'className' => 'SaleItem',
			'foreignKey' => 'sale_id',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		),
       'SaleCreditPayment' => array(
           'className' => 'SaleCreditPayment',
           'foreignKey' => 'sale_id',
           'dependent' => false,
           'conditions' => array('SaleCreditPayment.deleted'=>'n'),
           'fields' => '',
           'order' => array('SaleCreditPayment.id'=>'desc'),
           'limit' => '',
           'offset' => '',
           'exclusive' => '',
           'finderQuery' => '',
           'counterQuery' => ''
       )
	);

    
}
